
#include "data_global.h"


 //不同场景的互斥锁，作用于下述临界资源 (用于数据下发)
pthread_mutex_t mutex_led,
				mutex_seg,
				mutex_buzzer,
				mutex_fan;

//不同场景的条件变量，与互斥锁共用，实现同步 （用于数据下发）
pthread_cond_t  cond_led,
				cond_seg, 
				cond_buzzer,
				cond_fan;

//线程ID
pthread_t id_client_request, //数据下发
		  id_refresh,        //数据上传
		  id_led,
		  id_seg,
		  id_buzzer,
		  id_fan;
		  

//临界资源  （用于数据下发）
unsigned char  cmd_led;
unsigned char  cmd_seg;
unsigned char  cmd_buzzer;
unsigned char  cmd_fan;

//设备文件描述符
int ttyUSB0fd;
int buzzerfd;
int mpu6050fd;


//消息队列
int msgid;
key_t key;
//包装后的消息
struct msg msgbuf;

//共享内存
int shmid;
key_t shm_key;

//信号量
int semid;
key_t sem_key;

//安防监控项目所有的环境信息
struct env_info_client_addr  sm_all_env_info; 